<%@ page import="com.wmm.bean.Student" %>
<%@ page import="com.wmm.service.StudentService" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<script>
    function check() {
        var flag = confirm("确定删除这条记录吗？");

        if (flag) {
            return true;

        } else {
            return false;
        }
    }
</script>
<html>
<head>
    <title>查询界面</title>
</head>
<body>
<div style="text-align: right;"><a href="">删除所选中的全部</a></div>
<table width="100%" border="3px solid green" cellspacing="0px" cellpadding="0px">
    <caption style="font-size: larger;">学生信息显示</caption>
    <tr>
        <th>学号</th>
        <th>学生姓名</th>
        <th>性别</th>
        <th>出生日期</th>
        <th>邮箱</th>
        <th>备注信息</th>
        <th>班级编号</th>
        <th>操作</th>
    </tr>

    <%
        List<Student> list = (List<Student>) session.getAttribute("queryList");

        for( Student student : list) {
            request.setAttribute("student",student);
    %>
    <tr>
        <td><input type="checkbox" /></td>
        <td><%=student.getId()%></td>
        <td><%=student.getName()%></td>
        <td><%=student.getSex() %></td>
        <td><%=student.getBirthday()%></td>
        <td><%=student.getMailbox()%></td>
        <td><%=student.getMemo()%></td>
        <td><%=student.getClassNo()%></td>
        <td><a href="updateStudent?studentno=<%=student.getId()%>&method=query">修改</a> &nbsp;&nbsp; / &nbsp;&nbsp;<a href= "deleteStudent?studentno=${student.getStudentno()}" onclick="return check()">删除</a></td>
    </tr>
    <%
        }
    %>
</table>

</body>
</html>
